package czk.jvm.lecture.gc;
//CMS(contanct mark sweep )
//老年代垃圾回收期 ，并发标记回收
/**
 * -verbose:gc
 * -Xmx20m
 * -Xms20m
 * -XX:+PrintGCDetails
 * -XX:+UseConcMarkSweepGC
 * -XX:SurvivorRatio=8
 * -Xmn10m
 */
public class MyTest5 {
    public static void main(String[] args) {
        int size=1024*1024;
        byte[] byte1=new byte[4*size];
        System.out.println(1111);
        byte[] byte2=new byte[4*size];
        System.out.println(22222);
        byte[] byte3=new byte[4*size];
        System.out.println(3333);
        byte[] byte4=new byte[2*size];
        System.out.println(4444);
        /**
         * 1111
         * [GC (Allocation Failure) [ParNew: 5924K->618K(9216K),(新生代大小 一共9216k=9m) 0.0023829 secs] 5924K->4716K(19456K)(堆空间大小 19m), 0.0024546 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
         * 22222
         * [GC (Allocation Failure) [ParNew: 4953K->468K(9216K), 0.0035830 secs] 9051K->9259K(19456K), 0.0036229 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
         * [GC (CMS Initial Mark) [1 CMS-initial-mark: 8790K(10240K)] 13355K(19456K), 0.0001483 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
         * [CMS-concurrent-mark-start]
         * 3333
         * 4444
         * [CMS-concurrent-mark: 0.001/0.001 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
         * [CMS-concurrent-preclean-start]
         * [CMS-concurrent-preclean: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
         * [CMS-concurrent-abortable-preclean-start]
         * [CMS-concurrent-abortable-preclean: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
         * Heap
         *  par new generation   total 9216K, used 6905K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
         *   eden space 8192K,  78% used [0x00000000fec00000, 0x00000000ff249668, 0x00000000ff400000)
         *   from space 1024K,  45% used [0x00000000ff400000, 0x00000000ff4750c0, 0x00000000ff500000)
         *   to   space 1024K,   0% used [0x00000000ff500000, 0x00000000ff500000, 0x00000000ff600000)
         *  concurrent mark-sweep generation total 10240K, used 8790K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
         *  Metaspace       used 3108K, capacity 4496K, committed 4864K, reserved 1056768K
         *   class space    used 337K, capacity 388K, committed 512K, reserved 1048576K
         */
    }
}
